package com.ds.api.job;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;

import com.ds.api.dao.SysSheetMapper;
import com.ds.api.model.SysSheet;

@Service
public class SheetTask {
    @Autowired
    private SysSheetMapper mapper;
    
    /**
     * 每分钟检查过期单子
     * @description: TODO   
     * @author xiangwei
     * @date 2017年8月21日
     */
    @Scheduled(cron="0 */1 * * * ?")
    public void checksheet(){
        List<Integer> list=mapper.checksheet();
        for (Integer integer : list) {
            SysSheet sheet=new SysSheet();
            sheet.setStid(integer);
            sheet.setStatus("-1");
            mapper.updateByPrimaryKeySelective(sheet);
        }
    }
}
